import api from './request'

//登录
export const pleaLogin=(params)=>api.post('login',params)
//侧边栏
export const pleaMenus=(params)=>api.get('menus',{params})
//用户信息
export const pleaUsers=(params)=>api.get('users',{params})
//删除
export const pleaDelete=(params)=>api.delete(`users/${params.id}`,{params})
//修改状态
export const pleaState=(params)=>api.put(`users/${params.id}/state/${params.mg_state}`,{params})
//添加
export const pleaAdd=(params)=>api.post('users',params)
//编辑
export const pleaEdit=(params)=>api.put(`users/${params.id}`,params)
//角色列表
export const pleaRoles=(params)=>api.get('roles',{params})
//所有权限
export const pleaList=(params)=>api.get('rights/list',{params})
//添加角色
export const pleaRole=(params)=>api.post('roles',params)
//分配角色
export const pleaPersona=(params)=>api.put(`users/${params.id}/role`,params)
//编辑角色
export const pleaEditid=(params)=>api.put(`roles/${params.id}`,params)
//删除角色
export const pleaDel=(params)=>api.delete(`roles/${params.id}`,{params})
//获取添加权限列表
export const pleaTree=(params)=>api.get('rights/tree',params)
//添加角色权限
export const Addroles=(params)=>api.post(`roles/${params.id}/rights`,params)
//删除角色权限
export const pleaRemove=(params)=>api.delete(`roles/${params.roleId}/rights/${params.rightId}`,{params})
//商品数据列表
export const pleaGoods=(params)=>api.get('goods',{params})
//删除商品
export const pleaRem=(params)=>api.delete(`goods/${params.id}`,{params})
//编辑商品
export const Goodsedit=(params)=>api.put(`goods/${params.id}`,params)
//添加商品
export const getAdd=(params)=>api.post('goods',params)

//获取订单列表
export const getOrders=(params)=>api.get('orders',{params})
//获取商品分类
export const Categories=(params)=>api.get('categories',{params})
//静态参数列表
export const getCate=(params)=>api.get(`categories/${params.id}/attributes?sel=only`,{params})
export const attributesOnly=(params)=>api.get(`categories/${params.id}/attributes`,{params})
//动态参数列表
export const getMany =(params)=>api.get(`categories/${params.id}/attributes?sel=many`,{params})
export const attributesMany =(params)=>api.get(`categories/${params.id}/attributes`,{params})
//添加动态参数
export const getaddMany=(params)=>api.post(`categories/${params.id}/attributes`,params)
//添加静态参数
export const getaddOnly=(params)=>api.post(`categories/${params.id}/attributes`,params)
//修改静态参数
export const Onyledit=(params)=>api.put(`categories/${params.id}/attributes/${params.attrId}`,params)
//修改动态
export const Manyedit=(params)=>api.put(`categories/${params.cat_id}/attributes/${params.attr_id}`,params)
//删除动态参数
export const Deletemany=(params)=>api.delete(`categories/${params.cat_id}/attributes/${params.attr_id}`,params)


//商品分类数据
export const getCategories=(params)=>api.get('categories',{params})
//删除分类
export const remDelete=(params)=>api.delete(`categories/${params.id}`,{params})
//添加分类
export const addCategories=(params)=>api.post('categories',params)
//编辑分类
export const editCategories=(params)=>api.put(`categories/${params.id}`,params)


//获取物流进度
export const getKuaidi=(params)=>api.get(`kuaidi/${params.id}`,{params})
//数据报表
export const geReports=(params)=>api.get('reports/type/1',{params})


//图片上传
export const getUpload=(params)=>api.post('upload',params)